<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>龙翔收银系统</title>

		<link href="css/jquery.bxslider.css" rel="stylesheet" type="text/css">
		<link href="css/font-awesome.css" rel="stylesheet" />
		<link href="css/index.css" rel="stylesheet" />
      
	</head>
	<body>
		<div class="mainlayout">
			
			
				<!-- 查询内容 -->
				<div class="r_invoice_flow_inquiry">
						<!-- 报表 -->
						<ul class="hides"  >
							<li>
								<div>
									<table class="check_statements">
									 <form action="<%=path %>/sell/sell_findSellSort" method="post"  >
									  		
										<tr>
											<td width="8%" height="30" align="right" class="form_text"></td>
											<td width="10%" height="30" align="left" class="form_text">
												 快速查找：
                                           <select id="rpBankNo" name="s" onchange="setAccountName()" style="width: 20%;">
								      			<option value="">请选择</option>
                                                <option value="1">菜名</option>
                                                 <option value="2">（拼音码）</option>
                                                 <option value="3">月份</option>
                                                <option value="4">类别</option>
								  			</select> 
								  			 <input name="sell.name" type="txt"  style=" height:20px;width: 20%;"  >
											时间：
													<input id="trxDate" name="time" style="width:208px" value="" onfocus="WdatePicker()" name="trxDate" maxlength="10" size="12" readonly onclick="SelectDate( this, 'yyyy-MM-dd' )">
											
											</td><td width="8%" height="30" align="right" class="form_text"></td>
										</tr>
										<tr>
											<td align="center" colspan="8">
												<input  type="submit" class="buttonstyle" value="查 询" onclick="submitQuery()">
												<input  type="button" id="dao" class="buttonstyle" value="导出" onclick="exportInvoJourChec()">
											</td>
                                            
										</tr>
										</form>
									</table>
								</div>
								<!-- 报表查询后内容 -->
								<div>
									<table  cellspacing="0" cellpadding="4" class="banking_processing_con">
										<tr>
											<td colspan="3" class="table_tdheight">
											<span>查询结果 </span>
											
											<div style="float: right;margin-right: 20%;margin-top: 10px; ">
											  &nbsp;&nbsp;总份数:<i id = "fen" style="color: blue;;font-weight: bolder;font-size: 20px;"></i>
											  &nbsp;&nbsp;总两数:<i id = "liang" style="color: blue;;font-weight: bolder;font-size: 20px;"></i>
											  &nbsp;&nbsp;总收入金额:<i id = "sum" style="color:red ;font-weight: bolder;font-size: 20px;"></i>
											      <script src="js/jquery-1.10.2.js"></script>
									<script type="text/javascript">
						$(function(){	
		   var fens = 0;
		   var liangs = 0;
		   var sums  = 0;
		           	$("td[name='fens']").each(function(){   
                fens = fens+ parseInt($(this).text());  
                        });
                        	$("td[name='liangs']").each(function(){   
               liangs  = liangs +parseInt($(this).text());   
                        });
                        	$("td[name='sums']").each(function(){   
              sums = sums + parseFloat($(this).text());  
                        });
					 
					 $("#fen").text(fens);	
					 $("#liang").text(liangs);	
					 $("#sum").text(sums);	

            
              
                 $("#dao").click(function(){
                 
                 $.ajax({  
                                          type: 'post',  
                                          url: 'sell/sell_daoSell',
                                          dataType: 'text',  
                                          data:"sell.name="+$("#selllist").val(),
                                         success: function(data){
                                   if(data){
                                   alert("导出Excel表成功,文件成功导入到计算机D盘根目录下");
                                   }else{
                                   alert("导出Excel表失败,系统内部错误");
                                   }              
                                
                               
                           },  
                                 error: function(text) {
                                
                                  }  
                             });  
                });
                });
                
                
						</script>
											</div>
											</td>
											
										</tr>
										<tr >
											<td width="2"></td>
											<td align="center" valign="top">
											<form name="detailForm" method="post">
												<table  border="0" class="banking_processing_con_tit" cellspacing="0" cellpadding="4">
													<tr align="center" >											
														<th align="center">编号</th>
														<th  align="center">助记编号</th>
														<th align="center">菜名</th>
														<th align="center">拼音码</th>
                                                        <th align="center">单价</th>
                                                        <th align="center">单位</th>
                                                        <th align="center">数量</th>
                                                        <th align="center">小计</th>
                                                        
                                                         <th align="center">时间</th>
                                                          <th align="center">类别</th>
                                                             <th align="center">月份</th>
                                                             <th align="center">两</th>
                                                         <th align="center">操作</th>
													</tr>
												<s:property value="#request.sql" />
													  <s:iterator id="g" value="#request.selllist">
													  <input type="hidden" value="<s:property value="#request.sql" />" id="selllist" >
													<tr class="tr_addcolor">
													
													 <td align="center"> <s:property value="#g.id"/></td>
														 <td align="center"> <s:property value="#g.codeid"/></td>
                                                    <td align="center"> <s:property value="#g.name"/></td>
                                                   <td align="center"> <s:property value="#g.code"/></td>
                                                   <td align="center"> <s:property value="#g.price"/></td>
                                                   <td align="center"> <s:property value="#g.unit"/></td>
                                                   <td align="center" name="fens"  > <s:property value="#g.count"/>
                                                  
                                                   </td>
                                                    <td align="center" name = "sums"> <s:property value="#g.total"/></td>
                                                   <td align="center"> <s:property value="#g.time"/></td>
                                                      <td align="center"> <s:property value="#g.remarks"/></td>
                                                      <td align="center"> <s:property value="#g.month"/></td>
                                                      <td align="center"name = "liangs"> <s:property value="#g.liang"/></td>
                                                   <td align="center"> 
                                                   <a href="<%=path %>/sell/sell_deleteSell?sell.id=<s:property value="#g.id"/>">删除</a></td>
                                                  
													</tr>
													</s:iterator>
													<!-- 分页 -->
													<tr class="fenye_style">
														<td colspan="12" class="gigantic pagination">
														
															<a href="<%=path %>/sell/sell_findSellPage?pages=1" class="fa fa-angle-double-left" data-action="first"></a>
															<s:if test="#request.countpage==1"><a href="<%=path %>/greens/greens_findGreensPage?pages=1" class="fa fa-angle-left" data-action="previous"></a>
															</s:if><s:else>
															<a href="<%=path %>/sell/sell_findSellPage?pages=<s:property value="#request.pages+1"/>" class="fa fa-angle-left" data-action="previous"></a>
															</s:else><input type="text" value=<s:property value="#request.countpage"/> >
															<s:if test="#request.countpage==#request.pages">
															<a href="<%=path %>/sell/sell_findSellPage?pages=<s:property value="#request.countpage"/>" class="fa fa-angle-right" data-action="next"></a>
															</s:if><s:else>
															<a href="<%=path %>/sell/sell_findSellPage?pages=<s:property value="#request.countpage+1"/>" class="fa fa-angle-right" data-action="next"></a>
															</s:else>
															<a href="<%=path %>/sell/sell_findSellPage?pages=<s:property value="#request.pages"/>" class="fa fa-angle-double-right" data-action="last"></a>
														<font color="#A63E19">总记录数:</font><s:property value="#request.count"/>
                                                   
														</td>
													</tr>
												
												</table>
												</form>
											</td>
											<td width="2"></td>
										</tr>
									</table>
								</div>
							</li>
						</ul>
					
								</div>
							
				</div>
				
			
	
	   <script type="text/javascript" src="js/adddate.js"></script>
	
	</body>
</html>